using System.Collections;
using System.Collections.Generic;
using UnityEngine;

using UnityEngine;
using UnityEditor;

[CustomEditor(typeof(PolyTerrain))]
public class PolyTerrainEditorUI : Editor
{
    public override void OnInspectorGUI()
    {
        PolyTerrain polyTerrain = (PolyTerrain)target;

        DrawDefaultInspector();

        int newSeed = EditorGUILayout.IntField("Seed", polyTerrain.Seed);
        
        if (newSeed != polyTerrain.Seed)
        {
            polyTerrain.Seed = newSeed;
        }
        
        if (GUILayout.Button("随机生成"))
        {
            polyTerrain.Seed = (int)Random.Range(0, 10000);
        }
    }
}